#include <QApplication>
#include <QQuickView>
#include <memory>

class TestQml {
public:
  TestQml() { initView(); }
  ~TestQml() {}

  void show_window() {
    if (view_.get() == nullptr) {
      return;
    }

    view_->show();
  }

private:
  void initView() {
    view_.reset(new QQuickView());
    view_->setTitle("qml demo");
    view_->setColor(QColor(Qt::transparent));
    view_->setSource(QUrl("../test.qml"));
    view_->setFlags(Qt::BypassWindowManagerHint);
  }

private:
  std::unique_ptr<QQuickView> view_ = nullptr;
};

int main(int argc, char *argv[]) {
  QApplication a(argc, argv);
  TestQml t;
  t.show_window();

  return a.exec();
}
